﻿using browser4gp.core.Helpers;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using wpf4gp.Helpers;

namespace browser4gp.core.Style
{

    /// <summary>
    /// Stile della finestra
    /// </summary>
    public class MainWindowStyle : NotificationObject
    {
        /// <summary>
        /// Costruttore di base
        /// </summary>
        public MainWindowStyle()
        {
            string iconPath = Path.Combine(EnvironmentHelper.ApplicationDirectory, "Style", "Icons", "windowIcon.ico");
            if (File.Exists(iconPath))
            {
                Icon = BitmapFrame.Create(new Uri(iconPath, UriKind.RelativeOrAbsolute));
            }
        }

        #region Height


        private int _height = 768;

        /// <summary>
        /// Altezza finestra
        /// </summary>
        public int Height
        {
            get
            {
                return _height;
            }
            set
            {
                if (_height != value)
                {
                    _height = value;
                    RaisePropertyChanged(() => Height);
                }
            }
        }


        #endregion


        #region Width


        private int _width = 1024;

        /// <summary>
        /// Larghezza finestra
        /// </summary>
        public int Width
        {
            get
            {
                return _width;
            }
            set
            {
                if (_width != value)
                {
                    _width = value;
                    RaisePropertyChanged(() => Width);
                }
            }
        }


        #endregion


        #region WindowState

        private WindowState _windowState = WindowState.Normal;

        /// <summary>
        /// Stato della finestra
        /// </summary>
        public WindowState WindowState
        {
            get
            {
                return _windowState;
            }
            set
            {
                if (_windowState != value)
                {
                    _windowState = value;
                    RaisePropertyChanged(() => WindowState);
                }
            }
        }

        #endregion


        #region Background


        private Brush _background;

        /// <summary>
        /// Background
        /// </summary>
        public Brush Background
        {
            get
            {
                return _background;
            }
            set
            {
                if (_background != value)
                {
                    _background = value;
                    RaisePropertyChanged(() => Background);
                }
            }
        }


        #endregion


        #region Status bar


        private StatusBarStyle _statusBar;


        /// <summary>
        /// Stile della status bar
        /// </summary>
        public StatusBarStyle StatusBar
        {
            get
            {
                return _statusBar;
            }
            set
            {
                if (_statusBar != value)
                {
                    _statusBar = value;
                    RaisePropertyChanged(() => StatusBar);
                }
            }
        }


        #endregion


        #region Icon


        private ImageSource _icon;

        /// <summary>
        /// Path dell'icona di window
        /// </summary>
        public ImageSource Icon
        {
            get
            {
                return _icon;
            }
            set
            {
                if (_icon != value)
                {
                    _icon = value;
                    RaisePropertyChanged(() => Icon);
                }
            }
        }


        #endregion


        #region Font


        private int _fontSize = 14;

        /// <summary>
        /// Dimensione del font
        /// </summary>
        public int FontSize
        {
            get
            {
                return _fontSize;
            }
            set
            {
                if (_fontSize != value)
                {
                    _fontSize = value;
                    RaisePropertyChanged(() => FontSize);
                }
            }
        }



        private FontFamily _fontFamily = new FontFamily("Arial");

        /// <summary>
        /// Tipo di font
        /// </summary>
        public FontFamily FontFamily
        {
            get
            {
                return _fontFamily;
            }
            set
            {
                if (_fontFamily != value)
                {
                    _fontFamily = value;
                    RaisePropertyChanged(() => FontFamily);
                }
            }
        }

        #endregion

    }



    /// <summary>
    /// Stile per la status bar
    /// </summary>
    public class StatusBarStyle : NotificationObject
    {

        #region Background


        private Brush _background;

        /// <summary>
        /// Background
        /// </summary>
        public Brush Background
        {
            get
            {
                return _background;
            }
            set
            {
                if (_background != value)
                {
                    _background = value;
                    RaisePropertyChanged(() => Background);
                }
            }
        }


        #endregion


        #region ContentBackground


        private Brush _contentBackground;

        /// <summary>
        /// Background dei contenuti
        /// </summary>
        public Brush ContentBackground
        {
            get
            {
                return _contentBackground;
            }
            set
            {
                if (_contentBackground != value)
                {
                    _contentBackground = value;
                    RaisePropertyChanged(() => ContentBackground);
                }
            }
        }


        #endregion


        #region ContentForeground


        private Brush _contentForeground;

        /// <summary>
        /// Foreground dei contenuti
        /// </summary>
        public Brush ContentForeground
        {
            get
            {
                return _contentForeground;
            }
            set
            {
                if (_contentForeground != value)
                {
                    _contentForeground = value;
                    RaisePropertyChanged(() => ContentForeground);
                }
            }
        }


        #endregion


        #region Margin


        private Thickness _margin;

        /// <summary>
        /// Margini
        /// </summary>
        public Thickness Margin
        {
            get
            {
                return _margin;
            }
            set
            {
                if (_margin != value)
                {
                    _margin = value;
                    RaisePropertyChanged(() => Margin);
                }
            }
        }


        #endregion


        #region CornerRadius


        private string _cornerRadius;

        /// <summary>
        /// Arrotondamento angoli
        /// </summary>
        public string CornerRadius
        {
            get
            {
                return _cornerRadius;
            }
            set
            {
                if (_cornerRadius != value)
                {
                    _cornerRadius = value;
                    RaisePropertyChanged(() => CornerRadius);
                }
            }
        }


        #endregion


        #region BorderBrush


        private Brush _borderBrush;

        /// <summary>
        /// Colore bordi
        /// </summary>
        public Brush BorderBrush
        {
            get
            {
                return _borderBrush;
            }
            set
            {
                if (_borderBrush != value)
                {
                    _borderBrush = value;
                    RaisePropertyChanged(() => BorderBrush);
                }
            }
        }


        #endregion


        #region Height


        private int _height;

        /// <summary>
        /// Altezza
        /// </summary>
        public int Height
        {
            get
            {
                return _height;
            }
            set
            {
                if (_height != value)
                {
                    _height = value;
                    RaisePropertyChanged(() => Height);
                }
            }
        }


        #endregion

        
        #region Font


        private int _fontSize = 14;

        /// <summary>
        /// Dimensione del font
        /// </summary>
        public int FontSize
        {
            get
            {
                return _fontSize;
            }
            set
            {
                if (_fontSize != value)
                {
                    _fontSize = value;
                    RaisePropertyChanged(() => FontSize);
                }
            }
        }



        private FontFamily _fontFamily = new FontFamily("Arial");

        /// <summary>
        /// Tipo di font
        /// </summary>
        public FontFamily FontFamily
        {
            get
            {
                return _fontFamily;
            }
            set
            {
                if (_fontFamily != value)
                {
                    _fontFamily = value;
                    RaisePropertyChanged(() => FontFamily);
                }
            }
        }

        #endregion


    }
}
